inherited frmEmiteCarteira: TfrmEmiteCarteira
  Left = 726
  Top = 295
  Caption = 'Emiss'#227'o de Carteiras'
  ClientHeight = 258
  OldCreateOrder = True
  PixelsPerInch = 96
  TextHeight = 13
  inherited pnlOpcoes: TPanel
    Height = 173
    object Label6: TLabel
      Left = 8
      Top = 8
      Width = 44
      Height = 13
      Caption = 'Empresa:'
    end
    object Label2: TLabel
      Left = 8
      Top = 48
      Width = 41
      Height = 13
      Caption = 'Per'#237'odo:'
    end
    object Label3: TLabel
      Left = 144
      Top = 72
      Width = 6
      Height = 13
      Caption = 'a'
    end
    object Label1: TLabel
      Left = 8
      Top = 88
      Width = 35
      Height = 13
      Caption = 'Cliente:'
    end
    object Label4: TLabel
      Left = 8
      Top = 128
      Width = 27
      Height = 13
      Caption = 'Plano'
    end
    object edtEmpresa: TEdit
      Left = 8
      Top = 24
      Width = 49
      Height = 21
      CharCase = ecUpperCase
      TabOrder = 0
      OnExit = edtEmpresaExit
    end
    object btnEmpresa: TButton
      Left = 56
      Top = 24
      Width = 25
      Height = 21
      Caption = '...'
      TabOrder = 1
      TabStop = False
      OnClick = btnEmpresaClick
    end
    object stEmpresa: TStaticText
      Left = 80
      Top = 24
      Width = 345
      Height = 21
      AutoSize = False
      BorderStyle = sbsSingle
      TabOrder = 2
    end
    object edtDataInicial: TEdit
      Left = 8
      Top = 64
      Width = 121
      Height = 21
      Hint = 'Data inicial'
      TabOrder = 3
      OnExit = edtDataInicialExit
    end
    object edtDataFinal: TEdit
      Left = 168
      Top = 64
      Width = 121
      Height = 21
      Hint = 'Data final'
      TabOrder = 4
      OnExit = edtDataInicialExit
    end
    object edtCliente: TEdit
      Left = 8
      Top = 104
      Width = 49
      Height = 21
      CharCase = ecUpperCase
      TabOrder = 5
      OnExit = edtClienteExit
    end
    object btnCliente: TButton
      Left = 56
      Top = 104
      Width = 25
      Height = 21
      Caption = '...'
      TabOrder = 6
      TabStop = False
      OnClick = btnClienteClick
    end
    object stCliente: TStaticText
      Left = 80
      Top = 104
      Width = 345
      Height = 21
      AutoSize = False
      BorderStyle = sbsSingle
      TabOrder = 7
    end
    object edt_Plano: TEdit
      Left = 8
      Top = 144
      Width = 65
      Height = 21
      TabOrder = 8
      OnExit = edt_PlanoExit
    end
    object btnPlano: TBitBtn
      Left = 72
      Top = 144
      Width = 25
      Height = 21
      Caption = '...'
      TabOrder = 9
      TabStop = False
      OnClick = btnPlanoClick
    end
    object stPlano: TStaticText
      Left = 96
      Top = 144
      Width = 329
      Height = 21
      AutoSize = False
      BorderStyle = sbsSingle
      TabOrder = 10
    end
  end
  inherited pnlBotoes: TPanel
    Top = 214
  end
  inherited pnlCabecalho: TPanel
    Caption = 'Emiss'#227'o de Carteiras'
  end
  inherited sql_dataset_principal: TSQLClientDataSet
    CommandText = 
      'SELECT CO.PCN_PESSOAIDF,'#13#10'PL.PLA_DESCRICAO,'#13#10'CO.PCN_CONTRATOIDF,' +
      #13#10'CO.PCN_CONTRATOCOD,'#13#10'CO.PCN_DATAINICIO,'#13#10'CO.PCN_DATAFIM, '#13#10'CO.' +
      'PCN_VALORMENSAL,'#13#10'PE.CODPES,'#13#10'PE.NOMEPES,'#13#10'PE.ENDPES,'#13#10'PE.COMPPE' +
      'S,'#13#10'PE.BAIRROPES,'#13#10'PE.FONEPES,'#13#10'PE.CELPES,'#13#10'PE.CIDPES,'#13#10'PE.ESTPE' +
      'S,'#13#10'PE.NOMEDEP,'#13#10'EM.CODEMP,'#13#10'EM.FANTEMP,'#13#10'EM.NOMEEMP,'#13#10'EM.ENDEMP' +
      ','#13#10'EM.BAIRROEMP,'#13#10'EM.FONEEMP,'#13#10'EM.FAXEMP,'#13#10'EM.CIDEMP,'#13#10'EM.ESTEMP' +
      ','#13#10'EM.MAILEMP'#13#10'FROM PESSOAS_CONTRATOS CO'#13#10'INNER JOIN PESSOAS_PLA' +
      'NOS PL ON (PL.PLA_CODIGO=CO.PCN_PLANOIDF)'#13#10'INNER JOIN (select '#13#10 +
      '                      e.emp_codigo as codemp,'#13#10'                 ' +
      '     e.emp_fantas as fantemp,'#13#10'                      e.emp_razso' +
      'c as nomeemp,'#13#10'                      e.emp_endere as endemp,'#13#10'  ' +
      '                    e.emp_bairro as bairroemp,'#13#10'                ' +
      '      e.emp_fone as foneemp,'#13#10'                      e.emp_fax as' +
      ' faxemp,'#13#10'                      c.cid_descri as cidemp,'#13#10'       ' +
      '               e.emp_estcod as estemp,'#13#10'                      e.' +
      'emp_email as mailemp'#13#10'                      from empresas e'#13#10'   ' +
      '                   inner join cidades c on '#13#10'                   ' +
      '   (c.cid_codigo=e.emp_cidcod and '#13#10'                      c.cid_' +
      'estcod=e.emp_estcod)) EM '#13#10'ON (EM.CODEMP=CO.PCN_EMPRESA)'#13#10'INNER ' +
      'JOIN (select                           '#13#10'                       ' +
      '   p.pes_idfcod as codpes,'#13#10'                          p.pes_nome' +
      ' as nomepes,'#13#10'                          p.pes_endereco as endpes' +
      ','#13#10'                          p.pes_complemento as comppes,'#13#10'    ' +
      '                      p.pes_bairro as bairropes,'#13#10'              ' +
      '            p.pes_fone as fonepes,'#13#10'                          p.' +
      'pes_celular as celpes,'#13#10'                          d.dep_nome as ' +
      'nomedep,'#13#10'                          c.cid_descri as cidpes,'#13#10'   ' +
      '                       p.pes_estado as estpes '#13#10'                ' +
      '          from pessoas p'#13#10'                          left join pe' +
      'ssoa_dependentes d on                                           ' +
      '                      d.dep_pessoaidf=p.pes_idfcod'#13#10'            ' +
      '              inner join cidades c on (c.cid_codigo=p.pes_cidade' +
      ' and                               c.cid_estcod=p.pes_estado)) P' +
      'E '#13#10'ON (PE.CODPES=CO.PCN_PESSOAIDF)'
    Left = 136
    Top = 9
    object sql_dataset_principalPCN_PESSOAIDF: TIntegerField
      FieldName = 'PCN_PESSOAIDF'
      Required = True
    end
    object sql_dataset_principalPLA_DESCRICAO: TStringField
      FieldName = 'PLA_DESCRICAO'
      Required = True
      Size = 60
    end
    object sql_dataset_principalPCN_CONTRATOIDF: TIntegerField
      FieldName = 'PCN_CONTRATOIDF'
      Required = True
    end
    object sql_dataset_principalPCN_CONTRATOCOD: TStringField
      FieldName = 'PCN_CONTRATOCOD'
      Required = True
      Size = 13
    end
    object sql_dataset_principalPCN_DATAINICIO: TDateField
      FieldName = 'PCN_DATAINICIO'
    end
    object sql_dataset_principalPCN_DATAFIM: TDateField
      FieldName = 'PCN_DATAFIM'
    end
    object sql_dataset_principalPCN_VALORMENSAL: TFMTBCDField
      FieldName = 'PCN_VALORMENSAL'
      Precision = 15
      Size = 3
    end
    object sql_dataset_principalCODPES: TIntegerField
      FieldName = 'CODPES'
      Required = True
    end
    object sql_dataset_principalNOMEPES: TStringField
      FieldName = 'NOMEPES'
      Required = True
      Size = 60
    end
    object sql_dataset_principalENDPES: TStringField
      FieldName = 'ENDPES'
      Size = 60
    end
    object sql_dataset_principalCOMPPES: TStringField
      FieldName = 'COMPPES'
      Size = 60
    end
    object sql_dataset_principalBAIRROPES: TStringField
      FieldName = 'BAIRROPES'
      Size = 40
    end
    object sql_dataset_principalFONEPES: TStringField
      FieldName = 'FONEPES'
      Size = 30
    end
    object sql_dataset_principalCELPES: TStringField
      FieldName = 'CELPES'
      Size = 30
    end
    object sql_dataset_principalCIDPES: TStringField
      FieldName = 'CIDPES'
      Required = True
      Size = 40
    end
    object sql_dataset_principalESTPES: TStringField
      FieldName = 'ESTPES'
      Required = True
      Size = 2
    end
    object sql_dataset_principalNOMEDEP: TStringField
      FieldName = 'NOMEDEP'
      Size = 60
    end
    object sql_dataset_principalCODEMP: TSmallintField
      FieldName = 'CODEMP'
      Required = True
    end
    object sql_dataset_principalFANTEMP: TStringField
      FieldName = 'FANTEMP'
      Required = True
      Size = 60
    end
    object sql_dataset_principalNOMEEMP: TStringField
      FieldName = 'NOMEEMP'
      Required = True
      Size = 60
    end
    object sql_dataset_principalENDEMP: TStringField
      FieldName = 'ENDEMP'
      Size = 60
    end
    object sql_dataset_principalBAIRROEMP: TStringField
      FieldName = 'BAIRROEMP'
      Size = 40
    end
    object sql_dataset_principalFONEEMP: TStringField
      FieldName = 'FONEEMP'
      Size = 30
    end
    object sql_dataset_principalFAXEMP: TStringField
      FieldName = 'FAXEMP'
      Size = 30
    end
    object sql_dataset_principalCIDEMP: TStringField
      FieldName = 'CIDEMP'
      Required = True
      Size = 40
    end
    object sql_dataset_principalESTEMP: TStringField
      FieldName = 'ESTEMP'
      Required = True
      Size = 2
    end
    object sql_dataset_principalMAILEMP: TStringField
      FieldName = 'MAILEMP'
      Size = 60
    end
  end
  inherited rds_dataset_principal: TRvDataSetConnection
    Left = 104
    Top = 9
  end
  inherited RvSystemPDF: TRvSystem
    Left = 72
    Top = 9
  end
  object rvPessoas: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQLC_PESSOAS
    Left = 256
    Top = 73
  end
  object SQLC_PESSOAS: TZReadOnlyQuery
    Connection = DtmGeral.ZConexaoBanco
    SQL.Strings = (
      'SELECT'
      'PE.PES_IDFCOD,'
      'PE.PES_NOME,'
      'PE.PES_CODIGO,'
      'PE.PES_ENDERECO,'
      'PE.PES_CPFCNPJ,'
      'PE.PES_COMPLEMENTO,'
      'PE.PES_BAIRRO,'
      'PE.PES_CIDADE,'
      'PE.PES_ESTADO,'
      'PE.PES_FONE,'
      'PE.PES_CELULAR,'
      'DE.DEP_NOME,'
      'CID.CID_DESCRI'
      'FROM PESSOAS PE '
      
        'INNER JOIN CIDADES CID ON (CID.CID_CODIGO = PE.PES_CIDADE AND CI' +
        'D.CID_ESTCOD = PE.PES_ESTADO)'
      
        'inner join pessoas_contratos co on (co.pcn_pessoaidf = pe.pes_id' +
        'fcod)'
      
        'LEFT JOIN PESSOA_DEPENDENTES DE ON DE.DEP_PESSOAIDF=PE.PES_IDFCO' +
        'D'
      'ORDER BY PE.PES_IDFCOD')
    Params = <>
    Left = 216
    Top = 73
    object SQLC_PESSOASPES_IDFCOD: TIntegerField
      FieldName = 'PES_IDFCOD'
      Required = True
    end
    object SQLC_PESSOASPES_NOME: TStringField
      FieldName = 'PES_NOME'
      Required = True
      Size = 60
    end
    object SQLC_PESSOASPES_CODIGO: TStringField
      FieldName = 'PES_CODIGO'
      Size = 15
    end
    object SQLC_PESSOASPES_ENDERECO: TStringField
      FieldName = 'PES_ENDERECO'
      Size = 60
    end
    object SQLC_PESSOASPES_CPFCNPJ: TStringField
      FieldName = 'PES_CPFCNPJ'
      Size = 18
    end
    object SQLC_PESSOASPES_COMPLEMENTO: TStringField
      FieldName = 'PES_COMPLEMENTO'
      Size = 60
    end
    object SQLC_PESSOASPES_BAIRRO: TStringField
      FieldName = 'PES_BAIRRO'
      Size = 40
    end
    object SQLC_PESSOASPES_CIDADE: TStringField
      FieldName = 'PES_CIDADE'
      Required = True
      Size = 3
    end
    object SQLC_PESSOASPES_ESTADO: TStringField
      FieldName = 'PES_ESTADO'
      Required = True
      Size = 2
    end
    object SQLC_PESSOASPES_FONE: TStringField
      FieldName = 'PES_FONE'
      Size = 30
    end
    object SQLC_PESSOASPES_CELULAR: TStringField
      FieldName = 'PES_CELULAR'
      Size = 30
    end
    object SQLC_PESSOASCID_DESCRI: TStringField
      FieldName = 'CID_DESCRI'
      Required = True
      Size = 40
    end
  end
  object SQLC_DEPENDENTES: TZReadOnlyQuery
    Connection = DtmGeral.ZConexaoBanco
    SQL.Strings = (
      'SELECT DISTINCT'
      'DE.DEP_PESSOAIDF,'
      'DE.DEP_DEPENDENTEIDF,'
      'DE.DEP_NOME,'
      'DE.DEP_ESTADOCIVIL,'
      'DE.DEP_DATANASCIMENTO,'
      'DE.DEP_GRAU,'
      'DE.DEP_SEXO,'
      'PP.PAR_DESCRICAO'
      'FROM PESSOA_DEPENDENTES DE '
      'INNER JOIN PESSOA_PARENTESCOS PP ON PP.PAR_CODIGO = DE.DEP_GRAU'
      'INNER JOIN PESSOAS PE ON DE.DEP_PESSOAIDF=PE.PES_IDFCOD'
      'ORDER BY DE.DEP_DEPENDENTEIDF')
    Params = <>
    Left = 216
    Top = 121
    object SQLC_DEPENDENTESDEP_PESSOAIDF: TIntegerField
      FieldName = 'DEP_PESSOAIDF'
      Required = True
    end
    object SQLC_DEPENDENTESDEP_DEPENDENTEIDF: TIntegerField
      FieldName = 'DEP_DEPENDENTEIDF'
      Required = True
    end
    object SQLC_DEPENDENTESDEP_NOME: TStringField
      FieldName = 'DEP_NOME'
      Required = True
      Size = 60
    end
    object SQLC_DEPENDENTESDEP_ESTADOCIVIL: TStringField
      FieldName = 'DEP_ESTADOCIVIL'
      Size = 1
    end
    object SQLC_DEPENDENTESDEP_DATANASCIMENTO: TDateField
      FieldName = 'DEP_DATANASCIMENTO'
    end
    object SQLC_DEPENDENTESDEP_GRAU: TIntegerField
      FieldName = 'DEP_GRAU'
      Required = True
    end
    object SQLC_DEPENDENTESDEP_SEXO: TStringField
      FieldName = 'DEP_SEXO'
      Required = True
      Size = 1
    end
    object SQLC_DEPENDENTESPAR_DESCRICAO: TStringField
      FieldName = 'PAR_DESCRICAO'
      Required = True
      Size = 40
    end
  end
  object SQLC_CONTRATOS: TZReadOnlyQuery
    Connection = DtmGeral.ZConexaoBanco
    SQL.Strings = (
      'SELECT'
      'CO.PCN_PESSOAIDF,'
      'PL.PLA_DESCRICAO,'
      'CO.PCN_CONTRATOIDF,'
      'CO.PCN_CONTRATOCOD,'
      'CO.PCN_DATAINICIO,'
      'CO.PCN_DATAFIM,'
      'CO.PCN_VALORMENSAL,'
      'EM.EMP_ENDERE,'
      'EM.EMP_BAIRRO,'
      'EM.EMP_FONE,'
      'EM.EMP_FAX,'
      'EM.EMP_EMAIL,'
      'EM.CID_DESCRI AS EMP_CIDCOD,'
      'EM.EMP_ESTCOD'
      'FROM PESSOAS_CONTRATOS CO'
      'INNER JOIN PESSOAS_PLANOS PL ON (PL.PLA_CODIGO=CO.PCN_PLANOIDF)'
      'INNER JOIN '
      '(select e.emp_codigo,e.emp_fantas,e.emp_razsoc,e.emp_endere,'
      'e.emp_bairro,e.emp_fone,e.emp_fax,c.cid_descri,e.emp_estcod,'
      'e.emp_email from empresas e inner join cidades c on '
      '(c.cid_codigo=e.emp_cidcod and c.cid_estcod=e.emp_estcod))'
      'EM ON (EM.EMP_CODIGO=CO.PCN_EMPRESA)'
      
        'AND (CAST(CO.PCN_DATAINICIO AS DATE) BETWEEN :DATA01 AND :DATA02' +
        ')'
      'OR (CAST(CO.PCN_DATAFIM AS DATE) BETWEEN :DATA01 AND :DATA02)'
      'ORDER BY CO.PCN_CONTRATOIDF')
    Params = <
      item
        DataType = ftUnknown
        Name = 'DATA01'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DATA02'
        ParamType = ptUnknown
      end>
    Left = 352
    Top = 161
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'DATA01'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DATA02'
        ParamType = ptUnknown
      end>
    object SQLC_CONTRATOSPCN_PESSOAIDF: TIntegerField
      FieldName = 'PCN_PESSOAIDF'
      Required = True
    end
    object SQLC_CONTRATOSPLA_DESCRICAO: TStringField
      FieldName = 'PLA_DESCRICAO'
      Required = True
      Size = 60
    end
    object SQLC_CONTRATOSPCN_CONTRATOIDF: TIntegerField
      FieldName = 'PCN_CONTRATOIDF'
      Required = True
    end
    object SQLC_CONTRATOSPCN_CONTRATOCOD: TStringField
      FieldName = 'PCN_CONTRATOCOD'
      Required = True
      Size = 13
    end
    object SQLC_CONTRATOSPCN_DATAINICIO: TDateField
      FieldName = 'PCN_DATAINICIO'
    end
    object SQLC_CONTRATOSPCN_DATAFIM: TDateField
      FieldName = 'PCN_DATAFIM'
    end
    object SQLC_CONTRATOSPCN_VALORMENSAL: TFloatField
      FieldName = 'PCN_VALORMENSAL'
    end
    object SQLC_CONTRATOSEMP_ENDERE: TStringField
      FieldName = 'EMP_ENDERE'
      Size = 60
    end
    object SQLC_CONTRATOSEMP_BAIRRO: TStringField
      FieldName = 'EMP_BAIRRO'
      Size = 40
    end
    object SQLC_CONTRATOSEMP_FONE: TStringField
      FieldName = 'EMP_FONE'
      Size = 30
    end
    object SQLC_CONTRATOSEMP_FAX: TStringField
      FieldName = 'EMP_FAX'
      Size = 30
    end
    object SQLC_CONTRATOSEMP_ESTCOD: TStringField
      FieldName = 'EMP_ESTCOD'
      Required = True
      Size = 2
    end
    object SQLC_CONTRATOSEMP_EMAIL: TStringField
      FieldName = 'EMP_EMAIL'
      Size = 60
    end
    object SQLC_CONTRATOSEMP_CIDCOD: TStringField
      FieldName = 'EMP_CIDCOD'
      ReadOnly = True
      Size = 40
    end
  end
  object rvDependentes: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQLC_DEPENDENTES
    Left = 248
    Top = 121
  end
  object rvContratos: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQLC_CONTRATOS
    Left = 384
    Top = 161
  end
end
